package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.system.domain.ZzxxChoicequestion;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ZzxxChoicequestionMapper;
import com.ruoyi.system.service.IZzxxChoicequestionService;

/**
 * 选择题Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-06-20
 */
@Service
public class ZzxxChoicequestionServiceImpl implements IZzxxChoicequestionService 
{
    @Autowired
    private ZzxxChoicequestionMapper zzxxChoicequestionMapper;

    /**
     * 查询选择题
     * 
     * @param id 选择题主键
     * @return 选择题
     */
    @Override
    public ZzxxChoicequestion selectZzxxChoicequestionById(Long id)
    {
        return zzxxChoicequestionMapper.selectZzxxChoicequestionById(id);
    }

    /**
     * 查询选择题列表
     * 
     * @param zzxxChoicequestion 选择题
     * @return 选择题
     */
    @Override
    public List<ZzxxChoicequestion> selectZzxxChoicequestionList(ZzxxChoicequestion zzxxChoicequestion)
    {
        return zzxxChoicequestionMapper.selectZzxxChoicequestionList(zzxxChoicequestion);
    }

    /**
     * 新增选择题
     * 
     * @param zzxxChoicequestion 选择题
     * @return 结果
     */
    @Override
    public int insertZzxxChoicequestion(ZzxxChoicequestion zzxxChoicequestion)
    {
        zzxxChoicequestion.setCreateTime(DateUtils.getNowDate());
        return zzxxChoicequestionMapper.insertZzxxChoicequestion(zzxxChoicequestion);
    }

    /**
     * 修改选择题
     * 
     * @param zzxxChoicequestion 选择题
     * @return 结果
     */
    @Override
    public int updateZzxxChoicequestion(ZzxxChoicequestion zzxxChoicequestion)
    {
        zzxxChoicequestion.setUpdateTime(DateUtils.getNowDate());
        return zzxxChoicequestionMapper.updateZzxxChoicequestion(zzxxChoicequestion);
    }

    /**
     * 批量删除选择题
     * 
     * @param ids 需要删除的选择题主键
     * @return 结果
     */
    @Override
    public int deleteZzxxChoicequestionByIds(Long[] ids)
    {
        return zzxxChoicequestionMapper.deleteZzxxChoicequestionByIds(ids);
    }

    /**
     * 删除选择题信息
     * 
     * @param id 选择题主键
     * @return 结果
     */
    @Override
    public int deleteZzxxChoicequestionById(Long id)
    {
        return zzxxChoicequestionMapper.deleteZzxxChoicequestionById(id);
    }
}
